package com.hspedu.main_;

public class Main01 {
    private static String name = "小龙";
    private int num1 = 10;

    public static void main(String[] args) {
        hello();
        System.out.println(name);
        //System.out.println(num1);不行！！main也是個静态方法故只能调用静态的成员
        // hi();

        //如果想要调用非静态的成员，就需要先实例化，通过对象名来使用
        Main01 main01 = new Main01();
        System.out.println("num1="+main01.num1);
        main01.hi();
    }

    public void hi() {
        System.out.println("非静态方法hi()，hi~~");
    }

    public static void hello() {
        System.out.println("静态方法hello(),hello~~");
    }
}
